Repository navigation
feat: light/dark mode via Codex token mapping - #2
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AG Grid's themeQuartz defaults browserColorScheme to "light", emitting color-scheme: light on .ag-root-wrapper, which pinned Citizen's light-dark() Codex tokens to their light values inside the grid. Set browserColorScheme: 'inherit' so the wrapper inherits the page scheme. Verified: the grid background flips dark (night) / light (day) with the wiki theme toggle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refer to light-dark() color tokens / the page's mode rather than naming a specific skin. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
color-scheme is an inherited property, so .ext-aggrid already takes the page scheme from its ancestors. The grid's scheme is governed by the theme's browserColorScheme: 'inherit' (which controls .ag-root-wrapper). Verified the grid still flips dark/light with the rule removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make AGGrid grids follow the wiki's light/dark/OS colour scheme (and skin/wiki colour customisations) by mapping AG Grid 35's theme colour params to Codex design tokens (CSS variables). The grid tracks the wiki theme purely through the CSS cascade — no JS theme-syncing, no
data-ag-theme-mode.How it works
themeQuartz.withParams(...)whose colour params reference Codex tokens, e.g.backgroundColor: 'var(--background-color-base, #fff)'. Light fallbacks keep non-Codex skins rendering a usable light grid.browserColorScheme: 'inherit'is set so AG Grid's wrapper doesn't pincolor-schemeto light — lettinglight-dark()colour tokens resolve to the page's current mode inside the grid..ext-aggridalso declarescolor-scheme: inherit.mountGridapplies the theme only when the config has notheme, leaving a caller-provided theme untouched.Client-side only — no PHP/Lua changes.
Testing
browserColorScheme, theme-applied-vs-preserved, double-mount guard).npm run lintclean.🤖 Generated with Claude Code